<template lang="html">
  <div class="table-content">

    <el-table :data="tableData" size="mini" border style="width: 100%">
      <el-table-column
        type="selection"
        align="center"
        :selectable='selectInit'>
      </el-table-column>
      <el-table-column prop="username" label="员工账号" width="180"></el-table-column>
      <el-table-column prop="Emile" label="邮箱地址" width="180"></el-table-column>
      <el-table-column prop="phone" label="手机"></el-table-column>
      <el-table-column width="" label="操作">
        <el-button type="danger" size="mini" @click="ondelete">删除</el-button>
      </el-table-column>
    </el-table>
    <pagination
      @sendPageSize="receivePageSize"
      @sendCurrentPage="receiveCurrentPage"
      :totalPage="totalPage"
    ></pagination>
  </div>
</template>

<script>
import pagination from "common/pagination";
export default {
  data() {
    return {
      totalPage: 300,
      tableData: [
        {
          username: "王小虎",
          Emile: "13255655@163.com",
          phone: "13255655"
        },
        {
          username: "王二虎",
          Emile: "13255655@163.com",
          phone: "13255655"
        },
        {
          username: "王三虎",
          Emile: "13255655@163.com",
          phone: "13255655"
        },
        {
          username: "王大虎",
          Emile: "13255655@163.com",
          phone: "13255655"
        },
      ]
    };
  },
  methods: {
    receivePageSize(val) {
      console.log(val);
    },
    receiveCurrentPage(val) {
      console.log(val);
    },
    // 勾选方法
    // selectInit(row,index){
    //   if(row.propery == '1'){
    //     return false;
    //   }else{
    //     return true;
    //   }
    // },
    // 删除
    ondelete(){
      this.$confirm('此操作将永久删除该文件, 是否继续?', '提示', {
          confirmButtonText: '确定',
          cancelButtonText: '取消',
          type: 'warning'
        }).then(() => {
          this.$message({
            type: 'success',
            message: '删除成功!',
          });
        }).catch(() => {
          this.$message({
            type: 'info',
            message: '已取消删除'
          });          
        }
      );
    },
  },
  components: {
    pagination
  }
};
</script>

<style scoped lang="scss">
.table-content{
  margin-top: 20px;
  margin-bottom: 20px;
}
</style>